cmake_minimum_required(VERSION 3.15)
project(osgearth_map)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
SET(OSGEARTH_DIR "" CACHE PATH "set to base osg install path")
find_package(OpenSceneGraph REQUIRED osgDB osgGA osgViewer)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIR})

find_package(GDAL REQUIRED)
include_directories(${GDAL_INCLUDE_DIRS})

find_package(osgEarth)
include_directories(${OSGEARTH_INCLUDE_DIRS})

IF(NOT OSGEARTH_FOUND)
    message(FATAL_ERROR "OSGEARTH was not found! please set OSGEARTH_DIR.")
ENDIF()

add_executable (osgearth_map "osgearth_map.cpp")
target_link_libraries(${PROJECT_NAME} ${GDAL_LIBRARIES} ${OPENSCENEGRAPH_LIBRARIES} ${OSGEARTH_LIBRARY})


